@use '@material/data-table' as data-table;
@use '../theme/density.scss';

@mixin data-table-theme($theme) {
  $surface: map-get($theme, surface);
  $highlight: map-get($theme, surface-neutral-highlight);
  $highlight-hover: map-get($theme, surface-neutral-highlight-hover);
  $text: map-get($theme, text-primary-on-background);
  $hint-text: map-get($theme, text-hint-on-background);
  $icon: map-get($theme, text-icon-on-background);
  $divider: map-get($theme, divider);

  @include data-table.sort-icon-color($hint-text);
  @include data-table.sort-icon-active-color($icon);
  // @include data-table.header-row-fill-color,
  // @include data-table.row-fill-color();
  @include data-table.selected-row-fill-color($highlight);
  @include data-table.row-hover-fill-color($highlight-hover);
  @include data-table.header-row-text-color($text);
  @include data-table.row-text-color($text);
  @include data-table.divider-color($divider);
  @include data-table.stroke-size(0);

  .mdc-data-table {
    width: 100%;
    border-width: 0;
    white-space: normal;
  }

  .mdc-data-table__header-cell {
    font-family: var(--mdc-typography-font-family);
    font-size: var(--mdc-typography-body2-font-size);
    font-weight: 600;
    line-height: var(--mdc-typography-body2-line-height);
  }

  .mdc-data-table__sort-icon-button {
    font-size: 1rem;
  }

  .mdc-data-table__header-row {
    height: density.density-height(56px);
  }

  .mdc-data-table__row {
    height: density.density-height(52px);
  }
}
